﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.info.unit
{
    public partial class index : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                DataTable table = new UnitDao().SelectAll(base.Conn);
                if (table.Rows.Count > 0)
                {
                    this.litUnitName.Text = (table.Rows[0]["UnitName"] == DBNull.Value) ? "" : table.Rows[0]["UnitName"].ToString();
                    this.litTelNo.Text = (table.Rows[0]["TelNo"] == DBNull.Value) ? "" : table.Rows[0]["TelNo"].ToString();
                    this.litFaxNo.Text = (table.Rows[0]["FaxNo"] == DBNull.Value) ? "" : table.Rows[0]["FaxNo"].ToString();
                    this.litPostNo.Text = (table.Rows[0]["PostNo"] == DBNull.Value) ? "" : table.Rows[0]["PostNo"].ToString();
                    this.litAddress.Text = (table.Rows[0]["Address"] == DBNull.Value) ? "" : table.Rows[0]["Address"].ToString();
                    this.litUrl.Text = (table.Rows[0]["Url"] == DBNull.Value) ? "" : table.Rows[0]["Url"].ToString();
                    this.litEmail.Text = (table.Rows[0]["Email"] == DBNull.Value) ? "" : table.Rows[0]["Email"].ToString();
                    this.litBankName.Text = (table.Rows[0]["BankName"] == DBNull.Value) ? "" : table.Rows[0]["BankName"].ToString();
                    this.litBankNo.Text = (table.Rows[0]["BankNo"] == DBNull.Value) ? "" : table.Rows[0]["BankNo"].ToString();
                }
            }
        }
    }
}
